package br.inf.solutions.apresentacoes.ssp.view.composer.basicforms;

import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;

import br.com.vexillum.util.ReflectionUtils;
import br.com.vexillum.util.SpringFactory;
import br.inf.solutions.apresentacoes.ssp.control.basics.UniformController;
import br.inf.solutions.apresentacoes.ssp.model.basics.Uniform;

@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope("prototype")
public class UniformComposer extends BasicFormsComposer<Uniform, UniformController> {

	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);		
		loadBinder();
		doAction("listAll");
	}
	
	@Override
	protected String getUpdatePage() {
		return "/paginas/uniforme/modalCadastrar.zul";
	}
	
	@Override
	protected String getDeactivationMessage() {
		return "Tem certeza que deseja desativar ?";
	}
	
	@Override
	protected String getActivationMessage() {
		return "Tem certeza que deseja ativar?";
	}

	@Override
	public UniformController getControl() {
		return SpringFactory.getController("uniformController", UniformController.class, ReflectionUtils.prepareDataForPersistence(this));
	}

	@Override
	public Uniform getEntityObject() {
		return new Uniform();
	}
}